#!/usr/bin/python
# -*- encoding: utf-8 -*-
'''
@File    :   3client.py
@Time    :   2020/06/25 02:29:20
@Author  :   Malygos_l 
@Version :   1.0
@Contact :   751756061@qq.com
@WebSite :   www.gitee.com/malygos_l
'''
# Start typing your code from here
'''
udp
'''

from socket import *

ADDR = ('127.0.0.1', 8888)

cli = socket(AF_INET, SOCK_DGRAM)

while True:
    info = input('>>>')
    cli.sendto(info.encode(), ADDR)
    print("发送完成!")
    data, server = cli.recvfrom(1024)
    print("接受到服务器的消息:", data.decode("utf-8"))
    if data.decode() == 'end':
        break

cli.close()